package com.huanf.exception;

import com.huanf.enums.SystemEnum;
import lombok.Data;

//统一异常处理
@Data
public class SystemException extends RuntimeException{

    private int code;
    private String msg;

    public SystemException(SystemEnum httpCodeEnum) {
        super(httpCodeEnum.getMsg());
        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();
    }

    public SystemException(int code,String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}